﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace wesiGestClinica.acttar.popups
{
    public partial class FormsPopupBuscarServicios : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            Page.Header.Controls.Add(new LiteralControl(@"<base target=""_self"" />"));
            if (!Page.IsPostBack)
            {                               
            }
            UCBuscarServicio.btn_Buscar.Click += new EventHandler(btn_Buscar_Click);
            UCBuscarServicio.dgServicios.RowCommand += new GridViewCommandEventHandler(dgServicios_RowCommand);
        }

        void dgServicios_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Seleccionar")
            {
                GridViewRow fila = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                UCBuscarServicio.dgServicios.SelectedIndex = fila.RowIndex;
                string[] arr = e.CommandArgument.ToString().Split(new char[] { '|' });
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Envio", "enviarParam('" + arr[0] + "','" + arr[1] + "','" + arr[2] + "');", true);
            }
        }

        void btn_Buscar_Click(object sender, EventArgs e)
        {
            
        }
    }
}
